3.146 \(\int (a+b \sin (c+d x)) \tan ^2(c+d x) \, dx\)

Optimal. Leaf size=38 \[ \frac{a \tan (c+d x)}{d}-a x+\frac{b \cos (c+d x)}{d}+\frac{b \sec (c+d x)}{d} \]

[Out]

-(a*x) + (b*Cos[c + d*x])/d + (b*Sec[c + d*x])/d + (a*Tan[c + d*x])/d

________________________________________________________________________________________

Rubi [A]  time = 0.0593762, antiderivative size = 38, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 5, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.263, Rules used = {2722, 3473, 8, 2590, 14} \[ \frac{a \tan (c+d x)}{d}-a x+\frac{b \cos (c+d x)}{d}+\frac{b \sec (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sin[c + d*x])*Tan[c + d*x]^2,x]

[Out]

-(a*x) + (b*Cos[c + d*x])/d + (b*Sec[c + d*x])/d + (a*Tan[c + d*x])/d

Rule 2722

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((g_.)*tan[(e_.) + (f_.)*(x_)])^(p_.), x_Symbol] :> Int[Expan
dIntegrand[(g*Tan[e + f*x])^p, (a + b*Sin[e + f*x])^m, x], x] /; FreeQ[{a, b, e, f, g, p}, x] && NeQ[a^2 - b^2
, 0] && IGtQ[m, 0]

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2590

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> -Dist[f^(-1), Subst[Int[(1 - x^2
)^((m + n - 1)/2)/x^n, x], x, Cos[e + f*x]], x] /; FreeQ[{e, f}, x] && IntegersQ[m, n, (m + n - 1)/2]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rubi steps

\begin{align*} \int (a+b \sin (c+d x)) \tan ^2(c+d x) \, dx &=\int \left (a \tan ^2(c+d x)+b \sin (c+d x) \tan ^2(c+d x)\right ) \, dx\\ &=a \int \tan ^2(c+d x) \, dx+b \int \sin (c+d x) \tan ^2(c+d x) \, dx\\ &=\frac{a \tan (c+d x)}{d}-a \int 1 \, dx-\frac{b \operatorname{Subst}\left (\int \frac{1-x^2}{x^2} \, dx,x,\cos (c+d x)\right )}{d}\\ &=-a x+\frac{a \tan (c+d x)}{d}-\frac{b \operatorname{Subst}\left (\int \left (-1+\frac{1}{x^2}\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=-a x+\frac{b \cos (c+d x)}{d}+\frac{b \sec (c+d x)}{d}+\frac{a \tan (c+d x)}{d}\\ \end{align*}

Mathematica [A]  time = 0.0334988, size = 47, normalized size = 1.24 \[ -\frac{a \tan ^{-1}(\tan (c+d x))}{d}+\frac{a \tan (c+d x)}{d}+\frac{b \cos (c+d x)}{d}+\frac{b \sec (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sin[c + d*x])*Tan[c + d*x]^2,x]

[Out]

-((a*ArcTan[Tan[c + d*x]])/d) + (b*Cos[c + d*x])/d + (b*Sec[c + d*x])/d + (a*Tan[c + d*x])/d

________________________________________________________________________________________

Maple [A]  time = 0.026, size = 59, normalized size = 1.6 \begin{align*}{\frac{1}{d} \left ( a \left ( \tan \left ( dx+c \right ) -dx-c \right ) +b \left ({\frac{ \left ( \sin \left ( dx+c \right ) \right ) ^{4}}{\cos \left ( dx+c \right ) }}+ \left ( 2+ \left ( \sin \left ( dx+c \right ) \right ) ^{2} \right ) \cos \left ( dx+c \right ) \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sin(d*x+c))*tan(d*x+c)^2,x)

[Out]

1/d*(a*(tan(d*x+c)-d*x-c)+b*(sin(d*x+c)^4/cos(d*x+c)+(2+sin(d*x+c)^2)*cos(d*x+c)))

________________________________________________________________________________________

Maxima [A]  time = 2.72276, size = 53, normalized size = 1.39 \begin{align*} -\frac{{\left (d x + c - \tan \left (d x + c\right )\right )} a - b{\left (\frac{1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x+c))*tan(d*x+c)^2,x, algorithm="maxima")

[Out]

-((d*x + c - tan(d*x + c))*a - b*(1/cos(d*x + c) + cos(d*x + c)))/d

________________________________________________________________________________________

Fricas [A]  time = 1.70543, size = 108, normalized size = 2.84 \begin{align*} -\frac{a d x \cos \left (d x + c\right ) - b \cos \left (d x + c\right )^{2} - a \sin \left (d x + c\right ) - b}{d \cos \left (d x + c\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x+c))*tan(d*x+c)^2,x, algorithm="fricas")

[Out]

-(a*d*x*cos(d*x + c) - b*cos(d*x + c)^2 - a*sin(d*x + c) - b)/(d*cos(d*x + c))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \sin{\left (c + d x \right )}\right ) \tan ^{2}{\left (c + d x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x+c))*tan(d*x+c)**2,x)

[Out]

Integral((a + b*sin(c + d*x))*tan(c + d*x)**2, x)

________________________________________________________________________________________

Giac [B]  time = 8.56166, size = 1361, normalized size = 35.82 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x+c))*tan(d*x+c)^2,x, algorithm="giac")

[Out]

-(a*d*x*tan(d*x)*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c) - a*d*x*tan(1/2*d*x)^4*tan(1/2*c)^4 - 4*a*d*x*tan(d*x)*tan
(1/2*d*x)^3*tan(1/2*c)^3*tan(c) - 2*b*tan(d*x)*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c) + a*tan(d*x)*tan(1/2*d*x)^4*
tan(1/2*c)^4 + a*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c) + 4*a*d*x*tan(1/2*d*x)^3*tan(1/2*c)^3 + 2*b*tan(1/2*d*x)^4
*tan(1/2*c)^4 - a*d*x*tan(d*x)*tan(1/2*d*x)^4*tan(c) - 4*a*d*x*tan(d*x)*tan(1/2*d*x)^3*tan(1/2*c)*tan(c) - 4*a
*d*x*tan(d*x)*tan(1/2*d*x)*tan(1/2*c)^3*tan(c) + 8*b*tan(d*x)*tan(1/2*d*x)^3*tan(1/2*c)^3*tan(c) - a*d*x*tan(d
*x)*tan(1/2*c)^4*tan(c) - 4*a*tan(d*x)*tan(1/2*d*x)^3*tan(1/2*c)^3 - 4*a*tan(1/2*d*x)^3*tan(1/2*c)^3*tan(c) +
a*d*x*tan(1/2*d*x)^4 + 4*a*d*x*tan(1/2*d*x)^3*tan(1/2*c) + 4*a*d*x*tan(1/2*d*x)*tan(1/2*c)^3 - 8*b*tan(1/2*d*x
)^3*tan(1/2*c)^3 + a*d*x*tan(1/2*c)^4 - 2*b*tan(d*x)*tan(1/2*d*x)^4*tan(c) - 4*a*d*x*tan(d*x)*tan(1/2*d*x)*tan
(1/2*c)*tan(c) - 8*b*tan(d*x)*tan(1/2*d*x)^3*tan(1/2*c)*tan(c) - 24*b*tan(d*x)*tan(1/2*d*x)^2*tan(1/2*c)^2*tan
(c) - 8*b*tan(d*x)*tan(1/2*d*x)*tan(1/2*c)^3*tan(c) - 2*b*tan(d*x)*tan(1/2*c)^4*tan(c) - a*tan(d*x)*tan(1/2*d*
x)^4 - 4*a*tan(d*x)*tan(1/2*d*x)^3*tan(1/2*c) - 4*a*tan(d*x)*tan(1/2*d*x)*tan(1/2*c)^3 - a*tan(d*x)*tan(1/2*c)
^4 - a*tan(1/2*d*x)^4*tan(c) - 4*a*tan(1/2*d*x)^3*tan(1/2*c)*tan(c) - 4*a*tan(1/2*d*x)*tan(1/2*c)^3*tan(c) - a
*tan(1/2*c)^4*tan(c) + 2*b*tan(1/2*d*x)^4 + 4*a*d*x*tan(1/2*d*x)*tan(1/2*c) + 8*b*tan(1/2*d*x)^3*tan(1/2*c) +
24*b*tan(1/2*d*x)^2*tan(1/2*c)^2 + 8*b*tan(1/2*d*x)*tan(1/2*c)^3 + 2*b*tan(1/2*c)^4 + a*d*x*tan(d*x)*tan(c) +
8*b*tan(d*x)*tan(1/2*d*x)*tan(1/2*c)*tan(c) - 4*a*tan(d*x)*tan(1/2*d*x)*tan(1/2*c) - 4*a*tan(1/2*d*x)*tan(1/2*
c)*tan(c) - a*d*x - 8*b*tan(1/2*d*x)*tan(1/2*c) - 2*b*tan(d*x)*tan(c) + a*tan(d*x) + a*tan(c) + 2*b)/(d*tan(d*
x)*tan(1/2*d*x)^4*tan(1/2*c)^4*tan(c) - d*tan(1/2*d*x)^4*tan(1/2*c)^4 - 4*d*tan(d*x)*tan(1/2*d*x)^3*tan(1/2*c)
^3*tan(c) + 4*d*tan(1/2*d*x)^3*tan(1/2*c)^3 - d*tan(d*x)*tan(1/2*d*x)^4*tan(c) - 4*d*tan(d*x)*tan(1/2*d*x)^3*t
an(1/2*c)*tan(c) - 4*d*tan(d*x)*tan(1/2*d*x)*tan(1/2*c)^3*tan(c) - d*tan(d*x)*tan(1/2*c)^4*tan(c) + d*tan(1/2*
d*x)^4 + 4*d*tan(1/2*d*x)^3*tan(1/2*c) + 4*d*tan(1/2*d*x)*tan(1/2*c)^3 + d*tan(1/2*c)^4 - 4*d*tan(d*x)*tan(1/2
*d*x)*tan(1/2*c)*tan(c) + 4*d*tan(1/2*d*x)*tan(1/2*c) + d*tan(d*x)*tan(c) - d)